/*
 * @Description: 
 * @Author: Aroma
 * @Date: 2024-09-13 19:17:28
 * @LastEditors: Aroma
 * @LastEditTime: 2024-09-18 19:43:10
 * @别瞎看: 你个无脑牛马
 */
public class StudentTest {
    public static void main(String[] args) {
        // 创建Student对象并初始化
        Student student = new Student();

        // 验证getter方法
        System.out.println("Name: " + student.getName());
        System.out.println("Age: " + student.getAge());
        System.out.println("Gender: " + student.getGender());
        System.out.println("Student ID: " + student.getStudentId());

        // 修改Student对象的属性
        student.setName("Bob");
        student.setAge(22);
        student.setGender("Male");
        student.setStudentId("S7654321");

        // 再次验证getter方法以确认属性已更改
        System.out.println("\nAfter modification:");
        System.out.println("Name: " + student.getName());
        System.out.println("Age: " + student.getAge());
        System.out.println("Gender: " + student.getGender());
        System.out.println("Student ID: " + student.getStudentId());

        // 尝试设置不合法的值（可选，取决于你的setter方法中的验证逻辑）
        try {
            student.setAge(-5); // 假设我们不允许负数的年龄
        } catch (IllegalArgumentException e) {
            System.out.println("输入正确年龄: " + e.getMessage());
        }

        try {
            student.setStudentId(""); // 假设我们不允许空或空的学号
        } catch (IllegalArgumentException e) {
            System.out.println("学号不能为空 " + e.getMessage());
        }

        // 调用toString()方法查看对象的状态
        System.out.println("\nStudent details: " + student.toString());
    }
}